﻿
using Microsoft.Practices.Prism.Modularity ;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Prism.Logging;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.MefExtensions.Modularity;

namespace PrismExample.Weather
{
    [ModuleExport("Weather", typeof(ModuleInit))]
    public class ModuleInit : IModule
    {

        #region IModule Members

        public void Initialize()
        {
            var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
            regionManager.RegisterViewWithRegion("MainRegion", typeof(View));

            var logger = ServiceLocator.Current.GetInstance<ILoggerFacade>();
            logger.Log("Weather loaded", Category.Debug, Priority.Low);
        }

        #endregion
    }
}
